﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Utility.Extensions;

namespace QuickFramework.UICore.Controllers.Books
{
    /// <summary>
    /// 
    /// </summary>
    [Area("Books")]
    public class CountryController : Shared.Contracts.AuthorizeControllerBase
    {
        BookStores.IDomain.ICountry m_ICountry;
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="country"></param>
        public CountryController(BookStores.IDomain.ICountry country)
        {
            m_ICountry = country;
        }

        /// <summary>
        /// 获取国家列表
        /// url: /api/Books/Country/GetCounties
        /// </summary>
        /// <param name="keyWord"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<IActionResult> GetCounties(string keyWord, int pageIndex=1,int pageSize=1000)
        {
            return Ok(await m_ICountry.GetCountries(keyWord, pageIndex, pageSize));
        
        }

    }
}
